package org.poem.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.poem.result.CommonResult;
import org.poem.service.ITTaskTypeService;
import org.poem.task.TaskTypeVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author sangfor
 */
@RestController
@RequestMapping("/v1/taskType")
@Api(tags = {"07-任务类型接口"})
public class TaskTypeController {

    private static final Logger logger = LoggerFactory.getLogger(TaskTypeController.class);

    @Autowired
    private ITTaskTypeService taskTypeService;


    @ApiOperation(value = "0701_任务类型管理", notes = "根据id查询数据源详情")
    @ApiResponses({
            @ApiResponse(code = 400, message = "请求参数没有填好"),
            @ApiResponse(code = 404, message = "请求路径没有找到")
    })
    @GetMapping("/searchTaskType")
    @ResponseBody
    public CommonResult<List<TaskTypeVO>> searchTaskType() {
        logger.info("TaskTypeController:searchTaskType");
        List<TaskTypeVO> vos = taskTypeService.searchTaskType();
        return new CommonResult<>(vos);
    }
}
